<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			
			document.title = "js函数定义示例一";
			function factorial(x){
				if(x <= 1) return 1;
				else return x * factorial(x-1);
			}
			
			function printF(this){
				alert(factorial(5));
			}
			
		
			document.title = "Js函数定义示例二：";
			function printMsg(){
				alert("定义一个没有返回值的函数");
			}
//			printMsg();
		</script>
	</head>
	<body>
		<p>请输入要一个整数：</p>
		<input type="text" onBlur="printF(this)"/>
		<button onsubmit = "printMsg()">点我</button>
	</body>
</html>
